package com.dudsbury.database;
import org.joda.time.DateTime;


public class Booking {
	
	private DateTime date;
	private boolean bookingDay,bookingNight;
	private DateTime startTime,finishTime,bookingDate;
	private int occupancyAdult,occupancyChild,bookingId;
	private float deposit,itemTotal,otherExpenses,vat;
	private String bookingType,bookingName,details,room;

	private static final int BOOKING_ID = 0;
	private static final int BOOKING_TYPE = 1;
	private static final int BOOKING_NAME = 2;
	private static final int BOOKING_DATE = 3;
	private static final int BOOKING_DAY = 4;
	private static final int BOOKING_NIGHT = 5;
	private static final int START_TIME = 6;
	private static final int FINISH_TIME =7;
	private static final int ADULT_OCC = 8;
	private static final int CHILD_OCC = 9;
	private static final int DEPOSIT = 10;
	private static final int ITEM_TOTAL = 11;
	private static final int VAT = 12;
	private static final int TOTAL = 13;
	private static final int DETAILS = 14;
	private static final int ROOM = 15;
	
	public Booking() {
		
	}
	
	public Booking(String data[]) {
		this.bookingId = Integer.valueOf(data[BOOKING_ID]);
		this.bookingType = data[BOOKING_TYPE];
		this.bookingName = data[BOOKING_NAME];
		String hold[] = data[BOOKING_DATE].split("-");
		this.bookingDate = new DateTime(Integer.parseInt(hold[0]),Integer.parseInt(hold[1]),Integer.parseInt(hold[2]),0,0);
		this.bookingDay = Boolean.valueOf(data[BOOKING_DAY]);
		this.bookingDay = Boolean.valueOf(data[BOOKING_NIGHT]);
		hold = data[START_TIME].split(":");
		startTime = new DateTime(0,0,0,Integer.valueOf(hold[0]),Integer.valueOf(hold[1]));
		hold = data[FINISH_TIME].split(":");
		finishTime = new DateTime(0,0,0,Integer.valueOf(hold[0]),Integer.valueOf(hold[1]));
		occupancyAdult = Integer.valueOf(data[ADULT_OCC]);
		occupancyChild = Integer.valueOf(data[CHILD_OCC]);
		deposit = Float.valueOf(data[DEPOSIT]);
		itemTotal = Float.valueOf(data[ITEM_TOTAL]);
		vat = Float.valueOf(data[VAT]);
		
	}
	
	public String getRoom() {
		return room;
	}
	public void setRoom(String room) {
		this.room = room;
	}
	
	/*
	public MyBooking(MyDateTime date) {
		this.date=date;
	}
	*/
	public int getBookingId() {
		return bookingId;
	}
	public void setBookingId(int bookingId) {
		this.bookingId = bookingId;
	}
	public String getBookingType() {
		return bookingType;
	}
	public void setBookingType(String bookingType) {
		this.bookingType = bookingType;
	}
	public String getBookingName() {
		return bookingName;
	}
	public void setBookingName(String bookingName) {
		this.bookingName = bookingName;
	}
	public String getDetails() {
		return details;
	}
	public void setDetails(String details) {
		this.details = details;
	}
	public DateTime getDate() {
		return date;
	}
	public void setDate(DateTime date) {
		this.date = date;
	}
	public boolean isBookingDay() {
		return bookingDay;
	}
	public void setBookingDay(boolean bookingDay) {
		this.bookingDay = bookingDay;
	}
	public boolean isBookingNight() {
		return bookingNight;
	}
	public void setBookingNight(boolean bookingNight) {
		this.bookingNight = bookingNight;
	}
	public DateTime getStartTime() {
		return startTime;
	}
	public void setStartTime(DateTime startTime) {
		this.startTime = startTime;
	}
	public DateTime getFinishTime() {
		return finishTime;
	}
	public void setFinishTime(DateTime finishTime) {
		this.finishTime = finishTime;
	}
	public int getOccupancyAdult() {
		return occupancyAdult;
	}
	public void setOccupancyAdult(int occupancyAdult) {
		this.occupancyAdult = occupancyAdult;
	}
	public int getOccupancyChild() {
		return occupancyChild;
	}
	public void setOccupancyChild(int occupancyChild) {
		this.occupancyChild = occupancyChild;
	}
	public float getDeposit() {
		return deposit;
	}
	public void setDeposit(float deposit) {
		this.deposit = deposit;
	}
	
	
	public float getOtherExpenses() {
		return otherExpenses;
	}
	public void setOtherExpenses(float otherExpenses) {
		this.otherExpenses = otherExpenses;
	}
	@Override 
	public String toString() {
		return "Booking";
	}
	
	
	
}
